package com.neuedu.controller.workdocinfo;

import com.neuedu.factory.ClassFactory;
import com.neuedu.service.WorkRuleService;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

@WebServlet(name = "AddWorkDocInfoServlet", urlPatterns = "/his/addworkdocinfo")
public class AddWorkDocInfoServlet extends HttpServlet {
    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String lenstr = request.getParameter("0[length]");
        List<List<String>> listList = new ArrayList<>();
        int length = Integer.parseInt(lenstr);
        for (int i = 0; i < length; i++) {
            List<String> list = new ArrayList<>();
            for (int j = 0; j < 4; j++) {

            }
        }
        System.out.println("loginname:" + "");
//        String enddate2 = request.getParameter("enddate2");
//        String selectdeptdialog = request.getParameter("selectdeptdialog");
//        String ruleName = request.getParameter("ruleName");
//
//        Object[] objs = {ruleName,selectdeptdialog,startdate2,enddate2};
//        WorkRuleService wrs = (WorkRuleService) ClassFactory.createObj("WorkRuleService");
//        int id = wrs.addWorkRule(objs);
//        response.getWriter().append(Integer.toString(id));
    }

    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doPost(request, response);
    }
}
